package di.module;

import android.arch.lifecycle.ViewModel;
import android.arch.lifecycle.ViewModelProvider;

import dagger.Binds;
import dagger.Module;
import dagger.multibindings.IntoMap;
import di.scope.ViewModelKey;
import viewmodel.RedPackViewModel;
import viewmodel.ViewModelFactory;

@Module
public abstract class ViewModelModule {

  /*@Binds
  abstract ViewModelProvider.Factory bindViewModelFactory(ViewModelProvider.AndroidViewModelFactory factory);
*/
  @Binds
  abstract ViewModelProvider.Factory bindViewModelFactory(ViewModelFactory factory);

  @Binds
  @IntoMap
  @ViewModelKey(RedPackViewModel.class)
  abstract ViewModel  bindRedPackViewModel(RedPackViewModel redPackModule);

}
